﻿using System;
using System.Collections.Generic;
using Castle.DynamicProxy;
using Wisdom.Core;

namespace Wisdom.Core
{
    /// <summary>
    /// 描述：运用程序接口
    /// </summary>
    public interface IApplication : IDisposable
    {
        /// <summary>
        /// 获得 <see cref="Wisdom.Core.IConfigSource"/>实例.
        /// </summary>
        IConfigSource ConfigSource { get; }
        /// <summary>
        /// 获得容器 <see cref="IObjectContainer"/> 实例
        /// </summary>
        ObjectContainer ObjectContainer { get; }
        /// <summary>
        ///获得一个已注册到当前运用程序中指定<see cref="Castle.DynamicProxy.IInterceptor"/>类型实例的列表
        /// </summary>
        IEnumerable<IInterceptor> Interceptors { get; }
        /// <summary>
        /// 获取启动器实例
        /// </summary>
        IBootstrapper Bootstrapper { get; }
        /// <summary>
        /// 启动程序
        /// </summary>
        void Start();
        /// <summary>
        /// 结束程序
        /// </summary>
        void End();
        /// <summary>
        /// 当程序实始化完毕时事件发生.
        /// </summary>
        event EventHandler<AppEventArgs> Initialized;
        /// <summary>
        /// 当程序启动时事件发生.
        /// </summary>
        event EventHandler<AppEventArgs> Started;
        /// <summary>
        /// 当程序结束时发生
        /// </summary>
        event EventHandler<AppEventArgs> Ending;
    }
}